<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <style>
        *{margin:0;padding:0}
        img{
            width:200px;
            position: absolute;
            border:1px solid red;
            margin:50px;
        }
    </style>
</head>
<body>
    <img src="images/01.png" alt="">
    <script>
        var img = document.getElementsByTagName("img")[0]
        document.onmousemove = function(event){
            var pageX = event.pageX;
            var pageY = event.pageY;
            img.style.cssText = `left:${pageX}px;top:${pageY}px`
        }
    </script>
</body>
</html>